AHardwareBuffer_unlock

Unlock the AHardwareBuffer from direct CPU access.

Must be called after all changes to the buffer are completed by the caller. If \a fence is NULL, the function will block until all work is completed. Otherwise, \a fence will be set either to a valid file descriptor or to -1. The file descriptor will become signaled once the unlocking is complete and buffer contents are updated. The caller is responsible for closing the file descriptor once it's no longer needed. The value -1 indicates that unlocking has already completed before the function returned and no further operations are necessary.

Available since API level 26.

\return 0 on success. -EINVAL if \a buffer is NULL. Error number if the unlock fails for any reason.

static if(__ANDROID_API__ >= 26)
int
AHardwareBuffer_unlock

Meta